from django.contrib import admin
from .models import MerchantCategory, Merchant, MenuItem

# Register your models here.

@admin.register(MerchantCategory)
class MerchantCategoryAdmin(admin.ModelAdmin):
    list_display = ['name', 'description']
    search_fields = ['name']

@admin.register(Merchant)
class MerchantAdmin(admin.ModelAdmin):
    list_display = ['name', 'category', 'phone', 'is_active', 'rating', 'delivery_fee']
    list_filter = ['category', 'is_active']
    search_fields = ['name', 'address']
    
@admin.register(MenuItem)
class MenuItemAdmin(admin.ModelAdmin):
    list_display = ['name', 'merchant', 'category', 'price', 'is_available', 'stock', 'sales_count']
    list_filter = ['category', 'is_available', 'merchant']
    search_fields = ['name', 'description']
